import LoginStore from "./login.store"
import UserStore from "./user.store"
import ChannelStore from './channel.store'
import React from "react"
class RootStore {
  // 要使用的全部模块要在这里实例化
  constructor() {
    this.loginStore = new LoginStore()
    this.userStore = new UserStore()
    this.cannelStore = new ChannelStore()
  }
}
// 导入useStore方法供组件使用数据
const StoresContext = React.createContext(new RootStore())
export const useStore = () => React.useContext(StoresContext)